package com.sharding.test.web;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sharding.test.entity.TsLabels;
import com.sharding.test.service.TsLabelsService;

@RestController
@RequestMapping("/labels")
public class TsLabelsController {

	@Resource
	private TsLabelsService labelsService;
	
	@GetMapping("/create")
	public boolean create(TsLabels labels) {
		return labelsService.create(labels);
	}
	
	@GetMapping("/get/{id}")
	public TsLabels getLabels(@PathVariable("id")Integer id) {
		return labelsService.getById(id);
	}
}
